IDtoExchange={
         #上海
        "rb":'SHFE',"zn":'SHFE',"ag":'SHFE',"bu":'SHFE',"sp":'SHFE',
        "ss":'SHFE',"fu":'SHFE','ru':'SHFE', 'cu':'SHFE', 
        'al':'SHFE', 'ni':'SHFE', 'ag':'SHFE', 'hc':'SHFE', 
         'ao':'SHFE', 
        #大连
        "i":'DCE',"m":'DCE',"p":'DCE',"eg":'DCE',"l":'DCE',"v":'DCE',
        "pg":'DCE',"c":'DCE',"a":'DCE',"b":'DCE',"cs":'DCE',"eb":'DCE',
        "j":'DCE',"jm":'DCE',"pp":'DCE',"y":'DCE',"jd":'DCE',
        #郑州
        "SR":'CZCE',"TA":'CZCE',"SA":'CZCE',"FG":'CZCE','CF':'CZCE',
        "MA":'CZCE','AP':'CZCE','JD':'CZCE','CJ':'CZCE','OI':'CZCE',
        'PF':'CZCE','PX':'CZCE','RM':'CZCE','SF':'CZCE','SR':'CZCE',
        'UR':'CZCE','ZC':'CZCE','SM':'CZCE','SH':'CZCE',
        #能源
        "lu":'INE',"nr":'INE',"sc":'INE',"ec":'INE',
        #广期所
        'si':'GFEX',"lc":'GFEX',
        },
IDtoMiniprice={
   "rb":1,"zn":5,"ag":1,"bu":1,"sp":2,"ss":10,"fu":1,'ru':5,  #上海
   "i":0.5,"m":1,"p":2,"eg":1,"l":1,"v":1,"pg":1,"c":1,#大连
   "SR":1,"TA":2,"SA":2,"FG":1,'CF':5,"MA":1,#郑州
   "lu":1,"OI":1,"sc":0.1,#能源
},

def getCode(s):
    if s[1].isalpha():
        return s[:2]
    else:
        return s[1]
ctp_ZG_config={
   'investor_id': '8600276',
   'broker_id':'5300',
   'password':'cc9200',
   'trader_server':'tcp://180.166.58.211:41255',
   'port':41273,
   'app_id':'client_zgjyhft_1.0.0',
   'auth_code':'GKZNS2NU081BOIA7',
}
ctp_BC_config={
   'investor_id': '601230875',
   'broker_id':'0001',
   'password':'cc9200',
   'trader_server':'tcp://222.68.181.33:31205',
   'app_id':'client_bcjyhft_1.0.0',
   'auth_code':'EQC9HUWVKNE1Y8JV',
}
ctp_DC_config={
   'investor_id': '9020659',
   'broker_id':'9099',
   'password':'czp666666',
   'trader_server':'tcp://103.192.214.78:51205',
   'app_id':'client_jyhtf_1.0.0',
   'auth_code':'ZZOHMNBUCPXPII8K',
}
ctp_simnow_config={
  "investor_id": "086759",
  "broker_id": "9999",
  "password": "091297",
  "md_server": "tcp://180.168.146.187:10131",
  "trader_server": "tcp://180.168.146.187:10130",
  "app_id": "simnow_client_test",
  "auth_code": "0000000000000000"
}
orderStatusDict={
   '0':'全部成交',
   '1':'部分成交还在队列中',
   '2':'部分成交不在队列中',
   '3':'未成交还在队列中',
   '4':'未成交不在队列中',
   '5':'撤单',
   'a':'未知',
}
OffsetFlagDict={
   '0':'买',
   '1':'卖',
}
OpenCloseFlagDict={
   '0':'开',
   '1':'平',
   '2':'强平',
   '3':'平今',
   '4':'平昨',
   '5':'强减',
   '6':'本地强平',
}
OrderSubmitStatusDict={
   '0':'已经提交',
   '1':'撤单已经提交',
   '2':'修改已经提交',
   '3':'已经接受',
   '4':'报单已经被拒绝',
   '5':'撤单已经被拒绝',
   '6':'改单已经被拒绝',
}